package com.yjd.bi.rewards.service.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.bi.rewards.model.RaiseInterestVolumeModel;
import com.yjd.bi.rewards.service.IRaiseInterestVolumeService;
import com.yjd.bi.rewards.dao.IRaiseInterestVolumeDao;

/**
 * <b>description</b>：加息券业务实现<br>
 * <b>time</b>：2016-08-17 16:11:25 <br>
 * <b>author</b>：  renbangjie renbangjie@126.com
 */
@Service("raiseInterestVolumeService")
public class RaiseInterestVolumeServiceImpl extends BaseServiceImpl implements IRaiseInterestVolumeService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public RaiseInterestVolumeModel insert(RaiseInterestVolumeModel model) throws Exception {
		return this.raiseInterestVolumeDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(RaiseInterestVolumeModel model) throws Exception {
		return this.raiseInterestVolumeDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("id", id);
		return this.raiseInterestVolumeDao.deleteModel(paramMap, true);
	}

	@Resource
	private IRaiseInterestVolumeDao raiseInterestVolumeDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.raiseInterestVolumeDao;
	}

}
